A digital television (DTV) system is a television system in which a digital signal is used to broadcast an image and a sound. In the Moving Picture Experts Group (MPEG) standard, a transmit end (such as a television broadcast station server) in the DTV system uses a transport stream (TS) data packet as basic data and sends the transport stream data packet to a receive end (such as a set top box). The TS packet encapsulates data such as an audio, a video, program specific information, and system information (PSI/SI); the PSI is used to find, from received multiple TS packets, a TS packet that is corresponding to a program needing to be played and that carries audio/video data; and the SI includes electronic program guide information, such as a program name and a channel name that are of the program needing to be played. A digital television subscriber may perform program play control according to the PSI/SI. In a digital television system initialization stage, after receiving the TS packet, the receive end parses the PSI/SI encapsulated in the TS packet, to obtain the PSI/SI, and saves the PSI/SI in a nonvolatile memory (such as a flash). In a digital television system play stage, the digital television system reads, from the nonvolatile memory, the PSI/SI to a memory and uses the PSI/SI (for example, playing a corresponding program according to the PSI, and displaying the SI on a digital television display), so that the subscriber performs television play control.
A data format of the PSI/SI encapsulated in the TS packet is section, section data includes a large amount of cyclic structure data and variable-length string structure data, and a magnitude of each piece of cyclic structure data and a magnitude of each piece of string structure data may change from several bytes to hundreds of bytes. In the digital television system initialization stage, after receiving the section data, the receive end parses the section data to obtain the PSI/SI, and saves the PSI/SI (such as the cyclic structure data and the string structure data) in the nonvolatile memory in an array manner. In the digital television system play stage, after a digital television is powered on, the PSI/SI is read from the nonvolatile memory to a memory. A magnitude of an array needs to be preset, and generally, the magnitude of the array is an empirical value. Therefore, when the array is set to be excessively small, the PSI/SI stored in the nonvolatile memory may be lost, for example, channel program information is lost; and when the array is set to be excessively large, storage space of the nonvolatile memory may be wasted.